    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAkPJNybUvHJpbDyvMbkJmfBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRnU2vD0HImYahpRsJmNte2Tj_B6g"
            type="text/javascript"></script>

    <script type="text/javascript">
    
    //<![CDATA[
    function load() 
    {
      if (GBrowserIsCompatible()) 
      {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(47.614495, -122.341861), 13);
        
        GEvent.addListener(map, "click", function(overlay, point) 
        {
        	var label = document.getElementById("latlon_panel");
        	selectedLat = point.lat();
        	selectedLng = point.lng();
        	label.innerHTML = "Latitude: " + point.lat() + ", Longitude: " + point.lng();
        	var latInput = document.getElementById("selected_lat");
        	var lngInput = document.getElementById("selected_lng");
        	latInput.value = point.lat();
        	lngInput.value = point.lng();
		});
      }
    }    
    //]]>
    </script>

<div id="map" style="width: 600px; height: 400px"></div>
<div id="latlon_panel">Please select your location</div>
<form action="<?php echo url_for('@task_new')?>" method="post">
  <input type="hidden" name="selected_lat" id="selected_lat" value="-1"></input>
  <input type="hidden" name="selected_lng" id="selected_lng" value="-1"></input>
  <input type="submit" name="Submit" value="Done">
</form>
